import { api, authedApi } from '../utils/axios'

export function getProjectList(params={}) {
    return authedApi.get('/projects/', params);
}
//获取项目成员
export function getProjectData(id, params={}) {
    return authedApi.get(`/projects/${id}/members/`);
}
export function getUserListData(id, params={}) {
  return authedApi.get(`/projects/${id}/get_project_member`, params);
}
//创建项目
export function createProject(params={}) {
    return authedApi.post('/projects/', params);
}

export function updateProject(id, params={}) {
    return authedApi.put(`/projects/${id}/`, params);
}

export function deleteProject(id) {
    return authedApi.delete(`/projects/${id}/`);
}
//添加项目成员
export function addProjectMember(id, params={}) {
    return authedApi.post(`/projects/${id}/members/`, params);
}
//移除项目成员
export function removeProjectMember(project_id,useId) {
    return authedApi.delete(`/projects/${project_id}/members/${useId}`);
}
//转移项目
export function transfersProject(id, params={}) {
  return authedApi.post(`/projects/${id}/transfer/`, params);
}
//改变成员权限
export function change_authority(project_id,useId, params={}) {
  return authedApi.post(`/projects/${project_id}/members/${useId}/authority/`, params);
}
//收藏项目
export function collectProject(id,params={}) {
  return authedApi.post(`/projects/${id}/star/`,params);
}
//校验项目
export function checkIsRepeatofProject(params={}) {
  return authedApi.post(`/projects/validate/`, params);
}
// 快速入门判断 true为进入快速入门，false为不用进入快速入门
export function isQuickStart() {
  return authedApi.get(`/projects/is_quick_start/`);
}
// 获取快速入门进行步骤
export function getQuickStartFlow(project_id) {
  return authedApi.get(`/projects/${project_id}/quick_start/`);
}
//修改快速入门信息 stage=0为完成快速入门
export function putQuickStartFlow(project_id,params={}) {
  return authedApi.put(`/projects/${project_id}/quick_start/`,params);
}
